# -*- coding : utf_8 -*-
"""
=======================================
Time : 2025/4/28 21:26
Author : 田霄汉
Email : 522989570@qq.com
File : interview.py
Project : pytest_demo
=======================================
"""


# # 输出一个五行五列的*
# for i in range(5):
#     for j in range(5):
#         print('*', end='')
#     print()


# # 打印三角形的*
# for i in range(5):
#     for j in range(i+1):
#         print('*', end='')
#     print()


# # 打印九九乘法表
# for i in range(1, 10):
#     for j in range(1, i+1):
#         # print('%d * %d = ' % (j, i), i*j, '\t', end=' ')
#         print(f'{i} * {j} = {i*j}', end='\t')
#     print()


# # 快速选择排序
# origin_list = [2, 3, 1, 4, 5]
# for i in range(len(origin_list)-1):
#     # flag = False
#     for j in range(i+1, len(origin_list)):
#         if origin_list[i] > origin_list[j]:
#             origin_list[i], origin_list[j] = origin_list[j], origin_list[i]
#             # flag = True
#     # if not flag:
#     #     break
# print(origin_list)


# # 冒泡排序
# origin_list = [2, 3, 1, 5, 4]
# for i in range(len(origin_list)-1):
#     # flag = False
#     for j in range(len(origin_list)-1):
#         if origin_list[j] > origin_list[j+1]:
#             origin_list[j], origin_list[j+1] = origin_list[j+1], origin_list[j]
#     #         flag = True
#     # if not flag:
#     #     break
# print(origin_list)
